package it.sciuto.greetings.activities;

import it.sciuto.greetings.R;
import it.sciuto.greetings.adapters.FolderAdapter;

import java.io.File;
import java.util.Arrays;
import java.util.LinkedList;

import android.app.ListActivity;
import android.os.Bundle;
import android.widget.Gallery;

public class FolderActivity extends ListActivity {
	Gallery folderGallery;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		// Fade Animation
		overridePendingTransition(R.anim.fadein, R.anim.fadeout);

		// setContentView(R.layout.folder);
		// folderGallery = (Gallery) findViewById(R.id.gallery);
		// folderGallery.setSpacing(0);
		File directory = new File("/mnt/sdcard/greetings");
		if (!directory.exists())
			directory.mkdirs();
		String filename[] = directory.list();
		// for (String s : filename)
		// System.out.println(s);
		// folderGallery.setAdapter(new FolderAdapter(this, filename));
		setListAdapter(new FolderAdapter(this, new LinkedList<String>(Arrays.asList(filename))));
	}
}
